package com.yilin.tms.gps.controller;

import com.yilin.tms.core.application.ReturnData;
import com.yilin.tms.core.commons.base.BaseController;
import com.yilin.tms.core.commons.annotation.Explain;
import com.yilin.tms.core.commons.annotation.NotNull;
import com.yilin.tms.core.entity.gps.Location;
import com.yilin.tms.gps.service.IGpsBeidouService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;


@RestController
@RequestMapping("/gps/beidou/")
public class GpsBeiDouController extends BaseController {

    @Resource
    IGpsBeidouService gpsBeidouService;

    /**
     * 根据北斗定位时间查询线路
     * 【轨迹·付费】
     */
    @PostMapping("gpsDataWithTruckNoWithTime")
    @NotNull({"vehicleNo", "startTime","endTime","vco"})
    public ReturnData<Object> gpsDataWithTruckNoWithTime(@Explain("车牌号")String vehicleNo, @Explain("开始时间")Date startTime, @Explain("结束时间")Date endTime,@Explain("车牌颜色")String vco) {
        List<Location> gpsDataWithTruckNoWithTime = gpsBeidouService.getGpsDataWithTruckNoWithTime(vehicleNo, startTime, endTime,vco);
        return jsonView(SUCCESS_CODE, "获取轨迹成功！", gpsDataWithTruckNoWithTime);
    }


}
